<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>菜鸟教程</title>
<script>
function displayDate(){
	document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>
<p id="demo">
test
</p>
<script> 
function myfunction(){
	x=document.getElementById("demo");//找到元素
	x.innerHTML="Hello Javascript!";
	//x.innerHTML="Hello JavaScript!";    // 改变内容
}
</script>
<button type="button" onclick="myfunction()">
click here
</button>
window.alert("ddd")

<script>
function changeImage(){
	element=document.getElementById('myimage')
		if(element.src.match("bulbon")){
   element.src="./image/pic_bulboff.gif"
}
else{
	element.src="./image/pic_bulbon.gif"
}
}
</script>
<img id="myimage" onclick="changeImage()" src="./image/pic_bulboff.gif" width="100" height="180">
<p>点击灯泡就可以打开或关闭这盏灯</p>
<button value="click me" onclick=alert("ddd")>
</button>
</body>
</html>